import { defineComponent } from "vue";
import { textAreaProps } from "./types";
import { merge } from "lodash";
export default defineComponent({
  name: "text-area-view",
  props: textAreaProps,
  emits: ["change"],
  setup(_, { emit }) {
    const config = merge(_.item, { maxLength: 50 });
    const renderNum = () => {
      return (
        <div class="text-[12px] flex items-center justify-end mr-[10px] mb-[10px] h-[30px]">
          <span>{`限${config.maxLength}字`}</span>
        </div>
      );
    };
    return () => {
      return (
        <textarea
          placeholder="请输入"
          class={"resize-none !h-[103px] text-[14px] "}
          style={{ width: "100%" }}
          value={_.modelValue}
          onInput={(data: any) => {
            emit("change", data.target.value);
          }}
        />
      );
    };
  },
});
